A very small and simple PC/MAC/DS rendering lib using the 3d core to render 2D stuff. More...
Go to the source code of this file.
Classes | |
| struct | Image |
| Struct for our GL-Based Images This is our struct to hold our image attributes. You don't need to worry about this if you use the texture packer. More... | |
Defines | |
| #define | GL2D_RGBA(r, g, b, a) RGBA( b, g, r, a ) |
| Macro to use for all the color arguments of Easy GL2D primitives. | |
| #define | GL2D_RGB(r, g, b) RGBA( b, g, r, 255 ) |
| Macro to use for all the color arguments of Easy GL2D primitives. | |
Enumerations | |
| enum | GL2D_FLIP_MODE { FLIP_NONE = 1 shl 0, FLIP_V = 1 shl 1, FLIP_H = 1 shl 2 } |
Enums selecting flipping mode. More... | |
| enum | GL2D_BLEND_MODE { BLEND_TRANS = 0, BLEND_SOLID, BLEND_BLENDED, BLEND_GLOW, BLEND_ALPHA, BLEND_BLACK } |
Enums selecting Blending/Blitting mode. More... | |
Functions | |
| sub | Begin2D () |
| Sets up OpenGL for 2d rendering. Call this before drawing any of GL2D's drawing or sprite functions. | |
| sub | End2D () |
| Issue this after drawing 2d so that we don't mess the matrix stack. The compliment of glBegin2D(). | |
| sub | ScreenInit (byval as integer width, byval as integer height, byval as integer flags=0) |
| Initializes GL in 2D mode. | |
| sub | ShutDown () |
| Cleans up Easy GL2D. Call this at program end. External texture management is up for the user to clean up. | |
| sub | VsynchOn () |
| Forces video card to use vertical synching. Prevents "shearing" artifacts. | |
| function | LimitFPS (byval as single max_FPS) |
| Limits frames drawn per second. Call this if your game is frame-based as opposed to time-based. RETURN - Frames per Second (single) | |
| sub | SetBlendMode (byval as GL2D_BLEND_MODE mode) |
| Sets the default blending/blitting mode. | |
| sub | EnableSpriteStencil (byval as integer flag, byval as GLuint gl2dcolor, byval as GLuint gl2dcolor_env) |
| Sets texture environment color Used to draw sprites in a single fill color Very useful for flash/hit animations (1 - (texture image color)) * (glColor color) + (texture image color) * (texture environment color) ie. Pure White Sprites. | |
| sub | EnableAntialias (byval as integer flag=1) |
| sub | ClearScreen () |
| Clears the GL2D screen buffer. | |
| sub | LineGlow (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as integer width, byval as GLuint color, byval as image ptr spr=0) |
| Draws a glowing line. | |
| sub | Pset (byval as integer x, byval as integer y, byval as GLuint color) |
| Draws a Pixel. | |
| sub | Line (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as GLuint color) |
| Draws a Line. | |
| sub | LineGradient (int x1, int y1, int x2, int y2, const GLuint color1, const GLuint color2) |
| Draws a Line in a gradient color. | |
| sub | Box (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as GLuint color) |
| Draws a Box. | |
| sub | BoxFilled (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as GLuint color) |
| Draws a Box filled with a single color. | |
| sub | BoxFilledGradient (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as GLuint color1, byval as GLuint color2, byval as GLuint color3, byval as GLuint color4) |
| Draws a Box filled with a gradient color. | |
| sub | Triangle (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as integer x3, byval as integer y3, byval as GLuint color) |
| Draws a Triangle. | |
| sub | TriangleFilled (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as integer x3, byval as integer y3, byval as GLuint color) |
| Draws a Triangle filled with a single color. | |
| sub | TriangleFilledGradient (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as integer x3, byval as integer y3, byval as GLuint color1, byval as GLuint color2, byval as GLuint color3) |
| Draws a Triangle filled with a gradient color. | |
| sub | Ellipse (byval as integer x, byval as integer y, byval as integer a, byval as integer b, byval as integer degrees, byval as GLuint color) |
| Draws a hollow Ellipse. | |
| sub | EllipseFilled (byval as integer x, byval as integer y, byval as integer a, byval as integer b, byval as integer degrees, byval as GLuint color) |
| Draws a filled Ellipse. | |
| sub | Sprite (byval as integer x, byval as integer y, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Sprite. | |
| sub | SpriteScale (byval as integer x, byval as integer y, byval as single scale, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Scaled Sprite. | |
| sub | SpriteScaleXY (byval as integer x, byval as integer y, byval as single scaleX, byval as single scaleY, byval as integer flipmode, byval as Image ptr spr) |
| Draws an Axis Exclusive Scaled Sprite. | |
| sub | SpriteRotate (byval as integer x, byval as integer y, byval as integer angle, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Center Rotated Sprite. | |
| sub | SpriteRotateScale (byval as integer x, byval as integer y, byval as integer angle, byval as single scale, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Center Rotated Scaled Sprite. | |
| sub | SpriteRotateScaleXY (byval as integer x, byval as integer y, byval as integer angle, byval as single scaleX, byval as single scaleY, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Center Rotated Axis-Exclusive Scaled Sprite. | |
| sub | SpriteOnBox (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as single uoff, byval as single voff, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Stretched Sprite across a box Useful for "Shrearing Effects". | |
| sub | SpriteOnQuad (byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2, byval as integer x3, byval as integer y3, byval as integer x4, byval as integer y4, byval as single uoff, byval as single voff, byval as integer flipmode, byval as Image ptr spr) |
| Draws a Stretched Sprite across a quad Useful for "Shrearing Effects". | |
| sub | SpriteStretchHorizontal (byval as integer x, byval as integer y, byval as integer length, byval as Image ptr spr) |
| Draws a clean horizontally stretched Sprite<Br> Useful for lasers and huds. | |
| sub | SpriteStretchVertical (byval as integer x, byval as integer y, byval as integer height, byval as Image ptr spr) |
| Draws a clean vertically stretched Sprite<Br> Useful for lasers and huds. | |
| sub | SpriteStretch (byval as integer x, byval as integer y, byval as integer length, byval as integer height, byval as Image ptr spr) |
| Draws a clean horizontally and vertically stretched Sprite<Br> Useful for lasers, huds and dialog boxes. | |
| sub | PrintScale (byval as integer x, byval as integer y, byval as single scale, byref const as string text, byval as GLuint color) |
| Prints a text. | |
| sub overload | InitSprites (Image ptr SpriteSet(), Uinteger Texcoords(), byref filename as string, byval as GLuint filtermode=GL_NEAREST) |
| Initializes our spriteset with Texture Packer generated UV coordinates Very safe and easy to use.. | |
| sub overload | InitSprites (Image ptr SpriteSet(), byval as integer tile_wid, byval as integer tile_hei, byref filename as string, byval as GLuint filtermode=GL_NEAREST) |
| Initializes our Tileset (like GL2D.InitSpriteset()) but without the use of Texture Packer auto-generated files. Can only be used when tiles in a tilset are of the same dimensions. | |
| sub | DestroySprites (Image ptr Spriteset()) |
| Destroys/Deallocates/CleansUp our sriteset. Call this at program end. | |
| function | LoadBmpToGLsprite (byref as string filename, byval as GLuint filtermode=GL_NEAREST) |
| Loads a single power of 2 image. RETURN - sprite Pointer of GL2D.Image. | |
| function | LoadImageToHW (byval as Image ptr spr, byval as GLuint filtermode=GL_NEAREST) |
| Loads an GL2D/FB.Image to the Video hardware. RETURN - TRUE or FALSE. | |
| sub | GetImage (byval Image ptr SpriteDest, byval as Image ptr SpriteSource, byval as integer x1, byval as integer y1, byval as integer x2, byval as integer y2) |
| "Gets" a tile from a loaded spriteset. | |
| sub | FontLoad (byval as integer glyph_width, byval as integer glyph_height, byval as integer fontoffset, byref as string filename, byval as GLuint filter_mode=GL_NEAREST) |
| Loads a fontset for to replace the system font used bt PrintScale(). See fonts example for more details. | |
A very small and simple PC/MAC/DS rendering lib using the 3d core to render 2D stuff.
| #define GL2D_RGB | ( | r, | |
| g, | |||
| b | |||
| ) | RGBA( b, g, r, 255 ) |
Macro to use for all the color arguments of Easy GL2D primitives.
| r | Red channnel of the 32 bit color (0-255). |
| g | Green channnel of the 32 bit color (0-255). |
| b | Blue channnel of the 32 bit color (0-255). |
| #define GL2D_RGBA | ( | r, | |
| g, | |||
| b, | |||
| a | |||
| ) | RGBA( b, g, r, a ) |
Macro to use for all the color arguments of Easy GL2D primitives.
| r | Red channnel of the 32 bit color (0-255). |
| g | Green channnel of the 32 bit color (0-255). |
| b | Blue channnel of the 32 bit color (0-255). |
| a | Alpha channnel of the 32 bit color (0-255). |
| enum GL2D_BLEND_MODE |
| enum GL2D_FLIP_MODE |
Enums selecting flipping mode.
These enums are bits for flipping the sprites.
You can "or" GL_FLIP_V and GL_FLIP_H to flip both ways.
| sub Box | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as GLuint | color | ||
| ) |
Draws a Box.
| x1,y1 | Top-Left coordinate of the box. |
| x2,y2 | Bottom-Right coordinate of the box. |
| color | GL2D_RGBA color. |
| sub BoxFilled | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as GLuint | color | ||
| ) |
Draws a Box filled with a single color.
| x1,y1 | Top-Left coordinate of the box. |
| x2,y2 | Bottom-Right coordinate of the box. |
| color | GL2D_RGBA color. |
| sub BoxFilledGradient | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as GLuint | color1, | ||
| byval as GLuint | color2, | ||
| byval as GLuint | color3, | ||
| byval as GLuint | color4 | ||
| ) |
Draws a Box filled with a gradient color.
| x1,y1 | Top-Left coordinate of the box. |
| x2,y2 | Bottom-Right coordinate of the box. |
| color1 | GL2D_RGBA color of the Top-Left corner. |
| color2 | GL2D_RGBA color of the Bottom-Left corner. |
| color3 | GL2D_RGBA color of the Bottom-Right corner. |
| color4 | GL2D_RGBA color of the Top-Right corner. |
| sub DestroySprites | ( | Image ptr | Spriteset() ) |
Destroys/Deallocates/CleansUp our sriteset.
Call this at program end.
| SpriteSet() | an array of GL2D.Image. |
| sub Ellipse | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | a, | ||
| byval as integer | b, | ||
| byval as integer | degrees, | ||
| byval as GLuint | color | ||
| ) |
Draws a hollow Ellipse.
| x,y | Center of the ellipse. |
| a | Semi-major axis. |
| b | Semi-minor. |
| degrees | Angle(in degrees). |
| color | GL2D_RGBA color of the ellipse. |
| sub EllipseFilled | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | a, | ||
| byval as integer | b, | ||
| byval as integer | degrees, | ||
| byval as GLuint | color | ||
| ) |
Draws a filled Ellipse.
| x,y | Center of the ellipse. |
| a | Semi-major axis. |
| b | Semi-minor. |
| degrees | Angle(in degrees). |
| color | GL2D_RGBA color of the ellipse. |
| sub EnableAntialias | ( | byval as integer | flag = 1 ) |
Enables or disables AA depending on the switch param flag(optional) TRUE = enable; FALSE(0) = disable.
| sub EnableSpriteStencil | ( | byval as integer | flag, |
| byval as GLuint | gl2dcolor, | ||
| byval as GLuint | gl2dcolor_env | ||
| ) |
Sets texture environment color Used to draw sprites in a single fill color Very useful for flash/hit animations (1 - (texture image color)) * (glColor color) + (texture image color) * (texture environment color) ie. Pure White Sprites.
| gl2dcolor | color. |
| gl2dcolor_env | environment color. |
| flag | true == blendmode; false(0) == modulate. |
| sub FontLoad | ( | byval as integer | glyph_width, |
| byval as integer | glyph_height, | ||
| byval as integer | fontoffset, | ||
| byref as string | filename, | ||
| byval as GLuint | filter_mode = GL_NEAREST |
||
| ) |
Loads a fontset for to replace the system font
used bt PrintScale(). See fonts example for more details.
| glyph_width | width of each character in a fontset. |
| glyph_height | height of each character in a fontset. |
| fontoffset | character offset of the fontset(normally = 32). |
| filename | filename of the BMP file to load ie. "fontset.bmp". |
| filtermode(optional) | GL_NEAREST or GL_LINEAR. |
| sub GetImage | ( | byval Image ptr | SpriteDest, |
| byval as Image ptr | SpriteSource, | ||
| byval as integer | x1, | ||
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2 | ||
| ) |
"Gets" a tile from a loaded spriteset.
| SpriteDest | Destination pointer to GL2D.Image. |
| SpriteSource | Source pointer to GL2D.Image. |
| x1,y1 | Top-Left coordinate of the image to "get". |
| x2,y2 | Bottom-Right coordinate of the image to "get". |
| sub overload InitSprites | ( | Image ptr | SpriteSet(), |
| Uinteger | Texcoords(), | ||
| byref filename as | string, | ||
| byval as GLuint | filtermode = GL_NEAREST |
||
| ) |
Initializes our spriteset with Texture Packer generated UV coordinates
Very safe and easy to use..
| SpriteSet() | an array of GL2D.Image. |
| TexCoords() | Texture Packer auto-generated array of UV coords. |
| filename | filename of the BMP file to load ie. "ships.bmp". |
| filtermode(optional) | GL_NEAREST or GL_LINEAR. |
| sub overload InitSprites | ( | Image ptr | SpriteSet(), |
| byval as integer | tile_wid, | ||
| byval as integer | tile_hei, | ||
| byref filename as | string, | ||
| byval as GLuint | filtermode = GL_NEAREST |
||
| ) |
Initializes our Tileset (like GL2D.InitSpriteset()) but without the use of Texture Packer auto-generated files.
Can only be used when tiles in a tilset are of the same dimensions.
| SpriteSet() | an array of GL2D.Image. |
| filename | filename of the BMP file to load ie. "ships.bmp". |
| tile_wid | Width of each tile in the texture. |
| tile_hei | Height of each tile in the texture. |
| filtermode(optional) | GL_NEAREST or GL_LINEAR. |
| function LimitFPS | ( | byval as single | max_FPS ) |
Limits frames drawn per second.
Call this if your game is frame-based as opposed to time-based. RETURN - Frames per Second (single)
| max_FPS | maximum frames to draw per second. |
| sub Line | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as GLuint | color | ||
| ) |
Draws a Line.
| x1,y1 | Start point of the line. |
| y2,y2 | End point of the line. |
| color | GL2D_RGBA color. |
| sub LineGlow | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as integer | width, | ||
| byval as GLuint | color, | ||
| byval as image ptr | spr = 0 |
||
| ) |
Draws a glowing line.
| x1,y1 | Start point of the line. |
| y2,y2 | End point of the line. |
| width | Thickness of the line. |
| color | GL2D_RGBA color. |
| spr(optional) | an Image pointer for overriding default glow image. |
| sub LineGradient | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| const GLuint | color1, | ||
| const GLuint | color2 | ||
| ) |
Draws a Line in a gradient color.
| x1,y1 | Start point of the line. |
| y2,y2 | End point of the line. |
| color1 | Start point GL2D_RGBA color . |
| color2 | End point GL2D_RGBA color . |
| function LoadBmpToGLsprite | ( | byref as string | filename, |
| byval as GLuint | filtermode = GL_NEAREST |
||
| ) |
Loads a single power of 2 image.
RETURN - sprite Pointer of GL2D.Image.
| filename | filename of the BMP file to load ie. "ship.bmp". |
| filtermode(optional) | GL_NEAREST or GL_LINEAR. |
| function LoadImageToHW | ( | byval as Image ptr | spr, |
| byval as GLuint | filtermode = GL_NEAREST |
||
| ) |
Loads an GL2D/FB.Image to the Video hardware.
RETURN - TRUE or FALSE.
| spr | pointer to GL2D/FB.Image. |
| filtermode(optional) | GL_NEAREST or GL_LINEAR. |
| sub PrintScale | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as single | scale, | ||
| byref const as string | text, | ||
| byval as GLuint | color | ||
| ) |
Prints a text.
| x,y | Location of the sprite. |
| text | text to print. |
| scale | scaling factor of the glyph (1 = Normal). |
| color | GL2D_RGBA color of the Top-Right corner. |
| sub Pset | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as GLuint | color | ||
| ) |
Draws a Pixel.
| x | X position of the pixel. |
| y | Y position of the pixel. |
| color | GL2D_RGBA color. |
| sub ScreenInit | ( | byval as integer | width, |
| byval as integer | height, | ||
| byval as integer | flags = 0 |
||
| ) |
Initializes GL in 2D mode.
| width | width of the window. |
| height | height of the window. |
| flags(optional) | FBGFX flags |
| sub SetBlendMode | ( | byval as GL2D_BLEND_MODE | mode ) |
Sets the default blending/blitting mode.
| mode | enums for blending see example files. |
| sub Sprite | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Sprite.
| x | X position of the sprite. |
| y | Y position of the sprite. |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a Image. |
| sub SpriteOnBox | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as single | uoff, | ||
| byval as single | voff, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Stretched Sprite across a box
Useful for "Shrearing Effects".
| x1,y1 | First corner of the box. |
| x2,y2 | Second corner of the box. |
| uoff,voff | texture offsets. |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteOnQuad | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as integer | x3, | ||
| byval as integer | y3, | ||
| byval as integer | x4, | ||
| byval as integer | y4, | ||
| byval as single | uoff, | ||
| byval as single | voff, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Stretched Sprite across a quad
Useful for "Shrearing Effects".
| x1,y1 | First corner of the quad. |
| x2,y2 | Second corner of the quad. |
| x3,y3 | Third corner of the quad. |
| x4,y4 | Fourth corner of the quad. |
| uoff,voff | texture offsets. |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteRotate | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | angle, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Center Rotated Sprite.
| x | X position of the sprite center. |
| y | Y position of the sprite center. |
| angle | Angle(in degrees) to rotate the sprite. |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteRotateScale | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | angle, | ||
| byval as single | scale, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Center Rotated Scaled Sprite.
| x | X position of the sprite center. |
| y | Y position of the sprite center. |
| angle | Angle(in degrees) to rotate the sprite. |
| scale | scale value (1.0f is normal). |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteRotateScaleXY | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | angle, | ||
| byval as single | scaleX, | ||
| byval as single | scaleY, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Center Rotated Axis-Exclusive Scaled Sprite.
| x | X position of the sprite center. |
| y | Y position of the sprite center. |
| angle | Angle(in degrees) to rotate the sprite. |
| scaleX | X-Axis scale value (1.0f is normal). |
| scaleY | Y-Axis scale value (1.0f is normal). |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteScale | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as single | scale, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a Scaled Sprite.
| x | X position of the sprite. |
| y | Y position of the sprite. |
| scale | scale value (1.0f is normal). |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteScaleXY | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as single | scaleX, | ||
| byval as single | scaleY, | ||
| byval as integer | flipmode, | ||
| byval as Image ptr | spr | ||
| ) |
Draws an Axis Exclusive Scaled Sprite.
| x | X position of the sprite. |
| y | Y position of the sprite. |
| scaleX | X-Axis scale value (1.0f is normal). |
| scaleY | Y-Axis scale value (1.0f is normal). |
| flipmode | mode for flipping (see GL2D_FLIP_MODE enum). |
| spr | pointer to a GL2D.Image. |
| sub SpriteStretch | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | length, | ||
| byval as integer | height, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a clean horizontally and vertically stretched Sprite<Br> Useful for lasers, huds and dialog boxes.
| x,y | Location of the sprite. |
| length | length to stretch in pixels. |
| height | height to stretch in pixels. |
| spr | pointer to a GL2D.Image. |
| sub SpriteStretchHorizontal | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | length, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a clean horizontally stretched Sprite<Br> Useful for lasers and huds.
| x,y | Location of the sprite. |
| length | length to stretch in pixels. |
| spr | pointer to a GL2D.Image. |
| sub SpriteStretchVertical | ( | byval as integer | x, |
| byval as integer | y, | ||
| byval as integer | height, | ||
| byval as Image ptr | spr | ||
| ) |
Draws a clean vertically stretched Sprite<Br> Useful for lasers and huds.
| x,y | Location of the sprite. |
| height | height to stretch in pixels. |
| spr | pointer to a GL2D.Image. |
| sub Triangle | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as integer | x3, | ||
| byval as integer | y3, | ||
| byval as GLuint | color | ||
| ) |
Draws a Triangle.
| x1,y1 | Vertex 1 of the triangle. |
| x2,y2 | Vertex 2 of the triangle. |
| x3,y3 | Vertex 3 of the triangle. |
| color | GL2D_RGBA color of the triangle. |
| sub TriangleFilled | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as integer | x3, | ||
| byval as integer | y3, | ||
| byval as GLuint | color | ||
| ) |
Draws a Triangle filled with a single color.
| x1,y1 | Vertex 1 of the triangle. |
| x2,y2 | Vertex 2 of the triangle. |
| x3,y3 | Vertex 3 of the triangle. |
| color | GL2D_RGBA color of the triangle. |
| sub TriangleFilledGradient | ( | byval as integer | x1, |
| byval as integer | y1, | ||
| byval as integer | x2, | ||
| byval as integer | y2, | ||
| byval as integer | x3, | ||
| byval as integer | y3, | ||
| byval as GLuint | color1, | ||
| byval as GLuint | color2, | ||
| byval as GLuint | color3 | ||
| ) |
Draws a Triangle filled with a gradient color.
| x1,y1 | Vertex 1 of the triangle. |
| x2,y2 | Vertex 2 of the triangle. |
| x3,y3 | Vertex 3 of the triangle. |
| color1 | GL2D_RGBA color of the vertex 1. |
| color2 | GL2D_RGBA color of the vertex 2. |
| color3 | GL2D_RGBA color of the vertex 3. |
1.7.2